$OpenBSD: patch-libgo_configure,v 1.2 2015/07/19 21:22:49 pascal Exp $
--- libgo/configure.orig	Mon Jan  5 21:28:51 2015
+++ libgo/configure	Sat Jun 27 11:26:34 2015
@@ -675,6 +675,8 @@ LIBGO_IS_IRIX_FALSE
 LIBGO_IS_IRIX_TRUE
 LIBGO_IS_FREEBSD_FALSE
 LIBGO_IS_FREEBSD_TRUE
+LIBGO_IS_OPENBSD_FALSE
+LIBGO_IS_OPENBSD_TRUE
 LIBGO_IS_DARWIN_FALSE
 LIBGO_IS_DARWIN_TRUE
 go_include
@@ -10539,7 +10541,7 @@ openbsd*)
     *)				need_version=no  ;;
   esac
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  #finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
     case $host_os in
@@ -13465,6 +13467,10 @@ fi
 # architectures don't support it.  FIXME: We should set a default
 # based on the host.
 
+case ${host} in
+powerpc*-*-*) with_libffi_default=no ;;
+esac
+
 # Check whether --with-libffi was given.
 if test "${with_libffi+set}" = set; then :
   withval=$with_libffi; :
@@ -13492,6 +13498,7 @@ go_include="-include"
 
 is_darwin=no
 is_freebsd=no
+is_openbsd=no
 is_irix=no
 is_linux=no
 is_netbsd=no
@@ -13503,6 +13510,7 @@ GOOS=unknown
 case ${host} in
   *-*-darwin*)   is_darwin=yes;  GOOS=darwin ;;
   *-*-freebsd*)  is_freebsd=yes; GOOS=freebsd ;;
+  *-*-openbsd*)  is_openbsd=yes; GOOS=openbsd ;;
   *-*-irix6*)    is_irix=yes;    GOOS=irix ;;
   *-*-linux*)    is_linux=yes;   GOOS=linux ;;
   *-*-netbsd*)	 is_netbsd=yes;  GOOS=netbsd ;;
@@ -13535,6 +13543,14 @@ else
   LIBGO_IS_IRIX_FALSE=
 fi
 
+ if test $is_openbsd = yes; then
+  LIBGO_IS_OPENBSD_TRUE=
+  LIBGO_IS_OPENBSD_FALSE='#'
+else
+  LIBGO_IS_OPENBSD_TRUE='#'
+  LIBGO_IS_OPENBSD_FALSE=
+fi
+
  if test $is_linux = yes; then
   LIBGO_IS_LINUX_TRUE=
   LIBGO_IS_LINUX_FALSE='#'
@@ -14173,13 +14189,13 @@ fi
 
 
 PTHREAD_LIBS=
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5
-$as_echo_n "checking for pthread_create in -lpthread... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -pthread" >&5
+$as_echo_n "checking for pthread_create in -pthread... " >&6; }
 if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpthread  $LIBS"
+LIBS="-pthread  $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -14210,7 +14226,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5
 $as_echo "$ac_cv_lib_pthread_pthread_create" >&6; }
 if test "x$ac_cv_lib_pthread_pthread_create" = x""yes; then :
-  PTHREAD_LIBS=-lpthread
+  PTHREAD_LIBS=-pthread
 fi
 
 
